home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / MS_ARCAD.ZIP / ARC6_4.CHP < prev    next >
Text File  |  1993-06-15  |  4KB  |  98 lines

  1. %
  2. #EF
  3. #T15,1,Chapter 6     The Borland Graphics Interface     Pg. 13
  4. #HS,1,4,80,25,11,1
  5. #C4,R5
  6.                           ~W~IDrawing With The BGI~Y~I
  7.  
  8. There are too many drawing functions in the BGI for us to cover them all
  9. here. However, a brief summary of the functions we will use  most is
  10. presented in Figure 6.2, beginning on the next page. We should note that
  11. all of the drawing functions include the ability to clip against a viewport
  12. if we have turned clipping on. This is a very handy thing when drawing 3D
  13. scenes.
  14.  
  15. #WN
  16. The drawing functions include routines that draw lines, circles, ellipses,
  17. and arbitrarily shaped polygons. We can manipulate the screen pixel by
  18. pixel, or in groups of pixels. The foreground and background colors can be
  19. set, and we can manipulate the EGA and VGA palette registers.
  20.  
  21. #WN
  22. There are really quite a few tools for our use. I recommend that you be as
  23. lazy as possible and make the BGI do as much of your work as you can.
  24.  
  25. #WP
  26. %
  27. #EF
  28. #T15,1,Chapter 6     The Borland Graphics Interface     Pg. 14
  29. #HS,1,4,80,25,11,1
  30. #C2,R5
  31.                                  ~W~IFigure 6.2~Y~I
  32.                              Summary Of The BGI
  33.                        Drawing And Animation Functions
  34.  
  35. ╔═══════════════════════════════════════════════════════════════════════════╗
  36. ║ ~W~IName                   Purpose ~Y~I                                           ║
  37. ╙───────────────────────────────────────────────────────────────────────────╜
  38.   arc()                  Draws an arc.
  39.   bar()                  Draws a filled rectangle. Can also be used to
  40.                          blank out an area on the screen.
  41.   bar3d()                Draws a 3D bar.
  42.   circle()               Draws a circle. The parameters x and y specify the
  43.                          center of the circle. Only the circle's outline is
  44.                          drawn. The inside of the circle is not filled. The
  45.                          circle will look like a circle no matter what
  46.                          monitor is being used. The BGI automatically
  47.                          adjusts it based on the aspect ratio.
  48.  
  49. #C28,R23
  50. ~C~IContinued On Next Page~Y~I
  51. #WP
  52. %
  53. #EF
  54. #T15,1,Chapter 6     The Borland Graphics Interface     Pg. 15
  55. #HS,1,4,80,25,11,1
  56. #C2,R5
  57.                               ~W~IFigure 6.2 (cont)~Y~I
  58.                              Summary Of The BGI
  59.                        Drawing And Animation Functions
  60.  
  61. ╔═══════════════════════════════════════════════════════════════════════════╗
  62. ║ ~W~IName                   Purpose ~Y~I                                           ║
  63. ╙───────────────────────────────────────────────────────────────────────────╜
  64.   cleardevice()          Clears the screen and sets the graphics cursor
  65.                          (also called the current position) to 0,0.
  66.   drawpoly()             Draws an outline of a polygon of nearly any shape.
  67.   ellipse()              Draws an unfilled ellipse.
  68.   fillpoly()             Draws a filled polygon of nearly any shape.
  69.   floodfill()            Fills an area of the screen. Stops when it
  70.                          encounters the specified border color.
  71.   getimage()             Stores a bitmap into memory. Useful for doing
  72.                          bitblts.
  73. #C28,R23
  74. ~C~IContinued On Next Page~Y~I
  75. #WP
  76. %
  77. #EF
  78. #T15,1,Chapter 6     The Borland Graphics Interface     Pg. 16
  79. #HS,1,4,80,25,11,1
  80. #C2,R5
  81.                               ~W~IFigure 6.2 (cont)~Y~I
  82.                              Summary Of The BGI
  83.                        Drawing And Animation Functions
  84.  
  85. ╔═══════════════════════════════════════════════════════════════════════════╗
  86. ║ ~W~IName                   Purpose ~Y~I                                           ║
  87. ╙───────────────────────────────────────────────────────────────────────────╜
  88.   imagesize()            Returns the number of bytes needed to store a
  89.                          bitmap. Used when dynamically allocating space to
  90.                          store a bitmap into.
  91.   line()                 I'll give you one guess what this one does.
  92.   putimage()             Puts a bitmap to the screen. The bitmap should
  93.                          have been saved to memory using getimage(). This
  94.                          function is also needed for bitblts.
  95.   rectangle()            Draws an unfilled rectangle.
  96.  
  97. #WP
  98. #X